<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
	//return success('/admin/user/add','恭喜',3);
    return view('index');
});

//后台登录路由
Route::get('/admin/login','Admin\LoginController@login');
Route::post('/admin/checkLogin','Admin\LoginController@checkLogin');
//验证码
Route::get('/vcode','Admin\LoginController@vcode');


//建立后台路由

Route::group(['middleware'=>'login'],function(){
	//退出登录
	Route::get('/admin/logout','Admin\LoginController@logout');
	
	//后台首页
	Route::get('/admin/index','Admin\IndexController@index');

	//后台添加用户页面
	Route::get('/admin/user/add','Admin\UserController@add');

	//后台添加用户操作
	Route::post('/admin/user/insert','Admin\UserController@insert');

	//后台用户列表页面
	Route::get('/admin/user/index','Admin\UserController@index');

	//后台删除用户操作
	Route::get('/admin/user/delete','Admin\UserController@delete');

	//更新用户界面的方法
	Route::get('/admin/user/modify','Admin\UserController@modify');

	//更新用户操作
	Route::post('/admin/user/update','Admin\UserController@update');

	//查找用户界面
	Route::get('/admin/user/find','Admin\UserController@find');

	//查找用户操作
	Route::get('/admin/user/search','Admin\UserController@search');


	


	//商品操作有关路由
	//商品主页
	Route::get('/admin/goods/index','Admin\GoodsController@index');

	//添加商品页面
	Route::get('/admin/goods/add','Admin\GoodsController@add');

	//添加商品操作
	Route::post('/admin/goods/insert','Admin\GoodsController@insert');

	//更新商品操作
	Route::post('/admin/goods/update','Admin\GoodsController@update');

	//查找商品界面
	Route::get('/admin/goods/find','Admin\GoodsController@find');

	//更新商品信息
	Route::get('/admin/goods/modify','Admin\GoodsController@modify');

	//删除商品操作
	Route::get('/admin/goods/delete','Admin\GoodsController@delete');

	//查找商品操作
	Route::get('/admin/goods/search','Admin\GoodsController@search');




	//友情链接首页
	Route::get('/admin/flink/index','Admin\FlinkController@index');

	//添加友情链接页面
	Route::get('/admin/flink/add','Admin\FlinkController@add');

	//添加友情连接操作
	Route::post('/admin/flink/insert','Admin\FlinkController@insert');

	//删除友情链接操作
	Route::get('/admin/flink/delete','Admin\FlinkController@delete');

	//更新友情链接
	Route::get('/admin/flink/modify','Admin\FlinkController@modify');

	//更新友情链接操作
	Route::post('/admin/flink/update','Admin\FlinkController@update');

	//查找友情链接页面
	Route::get('/admin/flink/find','Admin\FlinkController@find');

	//查找友情链接操作
	Route::get('/admin/flink/search','Admin\FlinkController@search');


});

//前台登录页面
Route::get('/home/login','Home\LoginController@login');

//登录验证
Route::post('/home/checklogin','Home\LoginController@checklogin');

//前台主页
Route::get('/home/index','Home\IndexController@index');	

//前台主页
Route::get('/home/register','Home\IndexController@register');

//添加用户操作
Route::post('/home/insert','Home\IndexController@insert');

//退出登录操作
Route::get('/home/logout','Home\LoginController@logout');

//男士上装页面
Route::get('/home/nans','Home\IndexController@nans');


//建立前台路由
Route::group(['middleware'=>'qlogin'],function(){
	
	//订单页面
	Route::get('/home/order','Home\IndexController@order');

	//购物车页面
	Route::get('/home/mycart','Home\IndexController@mycart');

	


});

